debugger
const { SyncHook } = require('tapable');
let syncHook = new SyncHook(['name','age']);

syncHook.tap("1", (name, age) => {
    console.log('1',name, age);
});
syncHook.tap({name:'2'}, (name, age) => {
    console.log('2',name, age);
});
syncHook.tap("3", (name, age) => {
    console.log('3',name, age);
}); 
debugger
syncHook.call('zhufeng',12);
/**
 * 编译出来call方法长成这个样子
 * this._x里放的是所有的事件函数
 * this._x=[]
 * function (name, age) {
    var _x = this._x;

    var _fn0 = _x[0];
    _fn0(name, age);

    var _fn1 = _x[1];
    _fn1(name, age);

    var _fn2 = _x[2];
    _fn2(name, age);
   }
 */